    <script type="text/javascript">
		var geocoder;
		var map;
		var marker;
				
		var reg = new RegExp(/\d\d\d\d\d/);
		
		var j_address;
		var j_zip;
    
function initialize() {
      if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map_canvas"));
        map.addControl(new GLargeMapControl);
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(22.917922, -16.875),2);  
	
        var address	= document.getElementById("address").value;
	var zipcode	= document.getElementById("zipcode").value;
	var totaladdy	= address + " " + zipcode;
	
        geocoder    = new GClientGeocoder();

	geocoder.getLatLng(totaladdy,
    	    function(point) {
                
		if (!point) {
		    alert(address + " was not found");
		} else {
		    map.setCenter(point, 15);
		    getAddress(point)
		}
	    }
	);
      }
    }

    function getAddress(latlng) {
      if (latlng != null) {
        address = latlng;
        geocoder.getLocations(latlng, showAddress);
      }
    }

    function showAddress(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Status Code:" + response.Status.code);
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
	marker = new GMarker(point, {draggable: true});
	map.addOverlay(marker);	

	marker.openInfoWindowHtml('<b>Is this the desired address?</b>' + '<br>' + place.address);
	
	j_address = place.address;
	j_zip = reg.exec(place.address);
	updateAddress();
	GEvent.addListener(marker, "dragstart", function() {
          map.closeInfoWindow();
        });

        GEvent.addListener(marker, "dragend", getAddress);
      }
    }
		

    function updateAddress() {
        document.new_entry.addr.value = j_address;
	document.new_entry.zip.value = j_zip;
					
    }
		
		</script>
	 <div id="map_canvas" style="width: 480px; height: 320px"></div>


